package com.xiaolei.lib.annotation.translators;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

import com.xiaolei.lib.Activity.IActivity;
import com.xiaolei.lib.Activity.bean.AnnotationWrape;
import com.xiaolei.lib.annotation.OnActivityResult;
import com.xiaolei.lib.core.ITranslator;

/**
 * 返回到本界面的回调
 * @author xiaolei
 */
public class OnActivityResultTranslator implements ITranslator
{
	@Override
	public void execute(Field field, IActivity activity, AnnotationWrape annotation)
	{
		
	}

	@Override
	public void execute(Method method, IActivity activity, AnnotationWrape annotation)
	{
		OnActivityResult result = annotation.get(OnActivityResult.class);
		activity.addActivityResult(result.requestCode(), result.resultCode(),method);
	}

	@Override
	public void execute(Class<?> type, IActivity activity, AnnotationWrape annotation)
	{
		// TODO Auto-generated method stub

	}

}
